﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kevin.Framework.Data.OrmMapping;

namespace Kevin.WindosControls.Test.Entity
{
    [Serializable]
    [TableMapping("InputItem")]
    public class InputItemInfo : EntityBase
    {
        #region Constructor

        public InputItemInfo()
            : this("")
        { }
        public InputItemInfo(string connectionKey)
            : base(connectionKey)
        { }

        #endregion

        #region Methods

        public InputItemInfo Load()
        {
            List<InputItemInfo> list = this.SelectedByProperties<InputItemInfo>();
            return list[0];
        }

        static InputItemInfo _instance;
        public static InputItemInfo Instance
        {

            get
            {
                if (_instance == null)
                {
                    return new InputItemInfo();
                }
                else
                {
                    return _instance;
                }
            }
        }

        #endregion

        #region Properties

        private string _id;
        /// <summary>
        /// ID
        /// </summary>		
        [FieldMapping("ID")]

        public string ID
        {
            get
            {
                return _id;
            }
            set
            {
                if (_id != value)
                {
                    base.OnPropertyChanged("ID", _id, value);
                    _id = value;
                }
            }
        }

        private string _text;
        /// <summary>
        /// Text
        /// </summary>		
        [FieldMapping("Text")]

        public string Text
        {
            get
            {
                return _text;
            }
            set
            {
                if (_text != value)
                {
                    base.OnPropertyChanged("Text", _text, value);
                    _text = value;
                }
            }
        }

        private string _ctrltype;
        /// <summary>
        /// CtrlType
        /// </summary>		
        [FieldMapping("CtrlType")]

        public string CtrlType
        {
            get
            {
                return _ctrltype;
            }
            set
            {
                if (_ctrltype != value)
                {
                    base.OnPropertyChanged("CtrlType", _ctrltype, value);
                    _ctrltype = value;
                }
            }
        }

        private int _orderindex;
        /// <summary>
        /// OrderIndex
        /// </summary>		
        [FieldMapping("OrderIndex")]

        public int OrderIndex
        {
            get
            {
                return _orderindex;
            }
            set
            {
                if (_orderindex != value)
                {
                    base.OnPropertyChanged("OrderIndex", _orderindex, value);
                    _orderindex = value;
                }
            }
        }

        private string _formid;
        /// <summary>
        /// FormID
        /// </summary>		
        [FieldMapping("FormID")]

        public string FormID
        {
            get
            {
                return _formid;
            }
            set
            {
                if (_formid != value)
                {
                    base.OnPropertyChanged("FormID", _formid, value);
                    _formid = value;
                }
            }
        }

        private bool _visible;
        /// <summary>
        /// Visible
        /// </summary>		
        [FieldMapping("Visible")]
        public bool Visible
        {
            get
            {
                return _visible;
            }
            set
            {
                if (_visible != value)
                {
                    base.OnPropertyChanged("Visible", _visible, value);
                    _visible = value;
                }
            }
        }

        private string _datapropertyname;
        /// <summary>
        /// DataPropertyName
        /// </summary>		
        [FieldMapping("DataPropertyName")]
        public string DataPropertyName
        {
            get
            {
                return _datapropertyname;
            }
            set
            {
                if (_datapropertyname != value)
                {
                    base.OnPropertyChanged("DataPropertyName", _datapropertyname, value);
                    _datapropertyname = value;
                }
            }
        }
        #endregion
    }
}
